﻿@model IEnumerable<CardInChina.Data.Entity.Entity.Card>

<div class="sale">
    <div class="lm">
        <h2>
            特价促销</h2>
    </div>
    <div class="sale_list">
        <div class="sale_list_bg">
            <div class="sale_slider">
                <a class="prev ui-icons" id="infoPrevLink" href="#nolink" title="向左"></a>
                @for (int i = 0; i < Model.Count(); i++)
                {
                    CardInChina.Data.Entity.Entity.Card c = Model.ElementAt(i);
                    string photoPath = "/content/images/photo/" + c.Photo;
                    if (photoPath == null)
                    {
                        photoPath = "/content/images/ss.gif";
                    }
                    if (i == 0)
                    {
                          <div id="infoList">
                    <ul style="position: relative;">
                        <li>
                            <img src="@photoPath" alt="" />
                            </li>
                        <li>
                            @Html.ActionLink(c.CardMemo, "Index", "CardDetail", new { cardKey = c.OfCardInfo.CardKey }, null)
                        </li>
                    </ul>
                </div>
                    }
                    else
                    {
                         <div id="infoList@(i + 1)" style="display:none;">
                    <ul style="position: relative;">
                        <li>
                            <img src="@photoPath" alt="" /></li>
                        <li>
                            @Html.ActionLink(c.CardMemo, "Index", "CardDetail", new { cardKey = c.OfCardInfo.CardKey }, null)
                        </li>
                    </ul>
                </div>
                    }
                                
                }                
                <a class="next ui-icons" id="infoNextLink" href="#nolink" title="向右"><span></span>
                </a>
            </div>
            <div class="txtlist">
                <p class="ui-icons">
                </p>
                
                    @for(int k = 0 ; k < Model.Count() ; k++)
                    {
                        CardInChina.Data.Entity.Entity.Card c = Model.ElementAt(k);
                        if (k == 0)
                        {
                            <ul id="priceinfo"> 
                            <li>会员价: <span>@c.Price</span></li>
                            <li>ViP: <span>@c.VIPPrice</span></li>
                            </ul>
                        }
                        else
                        {
                             <ul id="priceinfo@(k+1)" style="display:none;"> 
                            <li>会员价: <span>@c.Price</span></li>
                            <li>ViP: <span>@c.VIPPrice</span></li>
                            </ul>
                        }
                        
                    }
                 
                
            </div>
        </div>
    </div>
    <div class="lb">
    </div>
</div>

<script type="text/javascript">
    $(function () {

        $("#infoPrevLink").click(function () {
            $("#infoList").show(500);
            $("#infoList2").hide(500);
            $(this).addClass("prev").removeClass("prev2");
            $("#infoNextLink").addClass("next").removeClass("next2");

        });


        $("#infoNextLink").click(function () {
            $("#infoList").hide(500);
            $("#infoList2").show(500);
            $(this).addClass("next2").removeClass("next");
            $("#infoPrevLink").addClass("prev2").removeClass("prev");

        });
    });
</script>